<template>
  <div class="person">
    <h1>广东</h1>
    <h2 ref="title2">深圳</h2>
    <h3>我家</h3>
    <button @click="showLog">点我输出h2这个元素</button>

  </div>
</template>

<script lang="ts" setup>
import { ref, reactive ,defineExpose} from "vue"

//创建一个titl2,用于存储ref标记内容
let title2 = ref()

let a = ref(1323213)
let b = ref(2333)

function showLog() {
  console.log(title2.value)
}

defineExpose({a,b})
</script>


<style lang="scss" scoped>
.person {
  background-color: skyblue;
  box-shadow: 0 0 10px;
  border-radius: 10px;
  color: white;
  padding: 20px;
}

button {
  margin: 0 5px;
}
</style>
